<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@page isELIgnored ="false"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>后台管理 - 易买网</title>
<link type="text/css" rel="stylesheet" href="../css/style.css" />
<script type="text/javascript" src="../scripts/function-manage.js"></script>
</head>
<body>
<div id="header" class="wrap">
	<div id="logo"><img src="../images/logo.gif" /></div>
	<div class="help"><a href="../index.html">返回前台页面</a></div>
	<div class="navbar">
		<ul class="clearfix">
			<li><a href="index.html">首页</a></li>
			<li class="current"><a href="user.html">用户</a></li>
			<li><a href="product.html">商品</a></li>
			<li><a href="order.html">订单</a></li>
			<li><a href="guestbook.html">留言</a></li>
			<li><a href="news.html">新闻</a></li>
		</ul>
	</div>
</div>
<div id="childNav">
	<div class="welcome wrap">
		管理员pillys您好，今天是2012-12-21，欢迎回到管理后台。
	</div>
</div>
<div id="position" class="wrap">
	您现在的位置：<a href="index.html">易买网</a> &gt; 管理后台
</div>
<div id="main" class="wrap">
	<%@include file ="common/lefter.jsp"%>
	<div class="main">
		<h2>修改用户</h2>
		<div class="manage">
			<form action="${pageContext.request.contextPath}/user/edit" method="post">
				<table class="form">
					<tr>
						<td class="field">用户名(*)：</td>
						<td><input type="text"  class="text" name="euUserId" value="${ebUser.euUserId}" readonly="readonly" /></td>
					</tr>
					<tr>
						<td class="field">真实姓名(*)：</td>
						<td><input type="text" class="text" name="euUserName" value="${ebUser.euUserName}" /></td>
					</tr>
					<tr>
						<td class="field">登录密码(*)：</td>
						<td><input type="text" class="text" name="euPassword" value="${ebUser.euPassword}" /></td>
					</tr>
					<tr>
						<td class="field">性别(*)：</td>
						<td><input type="radio" name="euSex" value="T" checked="checked" />男 <input type="radio" name="euSex" value="F" />女</td>
					</tr>
					<tr>
						<td class="field">出生日期(*)：</td>
						<td>
							<select name="birthYear"  id="bYear" onchange="loadMonth()" style="width:100px">
                             <c:forEach var="i" begin="1900" end="2020" step="1">
                            		<option value="${i}">${i}</option>
                            </c:forEach>
                            </select>年
                            <select name="birthMonth" onchange="loadDay()" id="bMonth" style="width:100px">
                            	<c:forEach var="i" begin="1" end="12" step="1">
                                 <option value="${i}">${i}</option>
                             </c:forEach>
                            </select>月
                            <select name="birthDay" id="bDay" style="width:100px">
                            <option value="2">2</option>
                            <option value="1" selected="selected">1</option>
                            </select>日
						</td>
					</tr>
					<tr>
					  <td class="field">身份证：</td>
					  <td><input type="text" class="text" name="euIdentityCode" id="identityCode" /></td>
				  </tr>
					<tr>
						<td class="field">手机号码：</td>
						<td><input type="text" class="text" name="euMobile" value="${ebUser.euMobile}" /></td>
					</tr>
					<tr>
						<td class="field">电子邮件：</td>
						<td><input type="text" class="text" name="euEmail" value="${ebUser.euEmail}" id="email" /></td>
					</tr>
					<tr>
						<td class="field">地址(*)：</td>
						<td><input type="text" class="text" name="euAddress" value="${ebUser.euAddress}" id="address" /></td>
					</tr>
					<tr>
                        <td class="field">用户级别(*)：</td>
                        <td><input type="text" class="text" name="euStatus" id="status" /></td>
                     </tr>
					<tr>
						<td></td>
						<td><label class="ui-blue"><input type="submit" name="submit" value="更新" /></label></td>
					</tr>
				</table>
			</form>
		</div>
	</div>
	<div class="clear"></div>
</div>
<div id="footer">
	Copyright &copy; 2016 湖南软测信息技术有限公司 All Rights Reserved. 湘ICP证1001号
</div>
</body>
</html>
<script type="text/javascript">
    function loadDay(){
        //alert(1);
        //1.获取你选择的年份和月份
        var yearVal = document.getElementById("bYear").value;
        var monthVal = document.getElementById("bMonth").value;
        //alert(yearVal+"===>"+monthVal);
        /** 2.确定天数
         *  大月  31天  1，3，5，7，8，10，12
         *  小月  30天  4,6,9,11
         *  二月  29天：闰年
         *       28天：平年
         */
        var days=0;
        if(monthVal==2){
            if((yearVal%4==0 )&& (yearVal%100!=0)||(yearVal%400==0)){
                days=29;
            }else{
                days=28;
            }
        }else if(monthVal==4||monthVal==6||monthVal==9||monthVal==11){
            days =30;
        }else{
            days = 31;
        }
        //3.为日的下拉列表添加days个option
        var birthdayEle = document.getElementById("bDay");

        //4.清除原来的option
        birthdayEle.options.length=0;
        //5.添加新的option
        for(var i=1;i<=days;i++){

            var option = new Option(i,i);

            birthdayEle.add(option);
        }

    }
    function loadMonth(){
        var monthEle = document.getElementById("bMonth");
        monthEle.options.length=0;
        monthEle.add(new Option("---请选择月份---","0"))
        for(var i=1;i<=12;i++){
            var option = new Option(i,i);
            monthEle.add(option);
        }

    }
</script>